<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<html>
<head>
  <title>订单管理</title>
  <!-- 引入 Bootstrap CSS -->
  <link rel="stylesheet" href=https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/4.3.1/css/bootstrap.min.css">
</head>
<body>
<div class="container mt-5">
  <div class="d-flex justify-content-between align-items-center mb-4">
    <h2 class="mb-0">订单管理</h2>
    <a href="${pageContext.request.contextPath}/index.jsp" class="btn btn-secondary">返回首页</a>
  </div>

  <table class="table table-bordered table-striped">
    <thead>
    <tr>
      <th>订单ID</th>
      <th>用户ID</th>
      <th>订单金额</th>
      <th>订单时间</th>
      <th>订单状态</th>
    </tr>
    </thead>
    <tbody>
    <c:if test="${empty ordersList}">
      <tr>
        <td colspan="6" class="text-center">没有找到任何订单。</td>
      </tr>
    </c:if>
    <c:forEach items="${ordersList}" var="order">
      <tr>
        <td>${order.oid}</td>
        <td>${order.uid}</td>
        <td>${order.ocount}</td>
        <td><fmt:formatDate value="${order.otime}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
        <td>${order.ostate}</td>
      </tr>
    </c:forEach>
    </tbody>
  </table>
</div>

<!-- 引入 jQuery -->
<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

<!-- 引入 Bootstrap JS -->
<script src="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/4.3.1/js/bootstrap.bundle.min.js"></script>
</body>
</html>